class Lodash {
    constructor() {

    }
    compact(array) {
        const newArr = [];
        for (let i = 0; i < array.length; i++) {
            if (!!array[i]) newArr.push(array[i])
        }
        return newArr
    }
}

const _ = new Lodash()



console.log(_.compact([0, 1, false, 2, '', 3]));
